'use strict'; var learts; var md=new MobileDetect(window.navigator.userAgent); ( function(){ learts=( function(){ return { init: function(){ this.closeTopBar(); this.offcanvas(); this.backToTop(); this.stickyHeader(); this.splitNavHeader(); this.headerOverlap(); this.verticalHeader(); this.blog(); this.switcher(); this.siteMenu(); this.mobileMenu(); this.search(); this.wishlist(); this.miniCart(); this.shop(); this.quickView(); this.notification(); this.compare(); this.ajaxAddToCart(); this.ajaxLoadMore(); this.product(); this.crossSells(); this.swatches(); this.quantityField(); this.imageCarousel(); this.instagramCarousel(); this.countdown(); this.productCategoriesShortcode(); this.productsShortCode(); this.vcTabs(); this.vcRow(); this.vcColumn(); this.cookie(); this.brand (); this.customJS(); this.instagram(); this.mailchimpSubscribe(); this.menuVertical(); this.menuGrid(); this.bannerCarousel(); this.testimonialCarousel(); }} }() ); } )(jQuery); jQuery(document).ready(function(){ learts.init(); }); ( function(window){ "use strict"; function GridLoaderFx(el, itemClass, callback){ this.el=el; this.items=this.el.querySelectorAll(itemClass); } GridLoaderFx.prototype.effects={ 'Hapi':{ animeOpts: { duration: function(t, i){ return 600 + i * 75; }, easing:'easeOutExpo', delay:function(t, i){ return i * 50; }, opacity:{ value:[0, 1], easing: 'linear' }, scale:[0, 1] }}, 'Amun':{ sortTargetsFn: function(a, b){ var aBounds=a.getBoundingClientRect(), bBounds=b.getBoundingClientRect(); return ( aBounds.left - bBounds.left )||( aBounds.top - bBounds.top ); }, animeOpts:{ duration:function(t, i){ return 500 + i * 50; }, easing:'easeOutExpo', delay:function(t, i){ return i * 20; }, opacity:{ value:[0, 1], duration: function(t, i){ return 250 + i * 50; }, easing:'linear' }, translateY: [400, 0] }}, 'Kek':{ sortTargetsFn: function(a, b){ return b.getBoundingClientRect().left - a.getBoundingClientRect().left; }, animeOpts:{ duration:800, easing:[0.1, 1, 0.3, 1], delay:function(t, i){ return i * 20; }, opacity:{ value:[0, 1], duration: 600, easing:'linear' }, translateX: [- 500, 0], rotateZ:[15, 0] }}, 'Isis':{ animeOpts: { duration:900, elasticity: 500, delay:function(t, i){ return i * 15; }, opacity:{ value:[0, 1], duration: 300, easing:'linear' }, translateX: function(){ return [anime.random(0, 1)===0 ? 100:- 100, 0]; }, translateY: function(){ return [anime.random(0, 1)===0 ? 100:- 100, 0]; }} }, 'Montu':{ perspective: 800, origin:'50% 0%', animeOpts:{ duration:1500, elasticity: 400, delay:function(t, i){ return i * 75; }, opacity:{ value:[0, 1], duration: 1000, easing:'linear' }, rotateX:[- 90, 0] }}, 'Osiris': { perspective: 3000, animeOpts:{ duration:function(){ return anime.random(500, 1000) }, easing:[0.2, 1, 0.3, 1], delay:function(t, i){ return i * 50; }, opacity:{ value:[0, 1], duration: 700, easing:'linear' }, translateZ: { value:[- 3000, 0], duration: 1000 }, rotateY:['-1turns', 0] }}, 'Satet':{ animeOpts: { duration:800, elasticity: 600, delay:function(t, i){ return i * 100; }, opacity:{ value:[0, 1], duration: 600, easing:'linear' }, scaleX:{ value: [0.4, 1] }, scaleY:{ value:[0.6, 1], duration: 1000 }} }, 'Atum':{ sortTargetsFn: function(a, b){ var docScrolls={ top: document.body.scrollTop + document.documentElement.scrollTop }, y1=window.innerHeight + docScrolls.top, aBounds=a.getBoundingClientRect(), ay1=aBounds.top + docScrolls.top + aBounds.height / 2, bBounds=b.getBoundingClientRect(), by1=bBounds.top + docScrolls.top + bBounds.height / 2; return Math.abs(y1 - ay1) - Math.abs(y1 - by1); }, perspective:1000, origin:'50% 0%', animeOpts:{ duration:800, easing:[0.1, 1, 0.3, 1], delay:function(t, i){ return i * 35; }, opacity:{ value:[0, 1], duration: 600, easing:'linear' }, translateX: [100, 0], translateY: [- 100, 0], translateZ: [400, 0], rotateZ:[10, 0], rotateX:[75, 0] }}, 'Ra':{ origin:'50% 0%', animeOpts: { duration:500, easing:'easeOutBack', delay:function(t, i){ return i * 100; }, opacity:{ value:[0, 1], easing: 'linear' }, translateY: [400, 0], scaleY:[{ value:[3, 0.6], delay:function(t, i){ return i * 100 + 120; }, duration: 300, easing:'easeOutExpo' }, { value:[0.6, 1], duration: 1400, easing:'easeOutElastic' }], scaleX:[{ value:[0.9, 1.05], delay:function(t, i){ return i * 100 + 120; }, duration: 300, easing:'easeOutExpo' }, { value:[1.05, 1], duration: 1400, easing:'easeOutElastic' }] }}, 'Sobek':{ animeOpts: { duration:600, easing:'easeOutExpo', delay:function(t, i){ return i * 100; }, opacity:{ value:[0, 1], duration: 100, easing:'linear' }, translateX: function(t, i){ var docScrolls={ left: document.body.scrollLeft + document.documentElement.scrollLeft }, x1=window.innerWidth / 2 + docScrolls.left, tBounds=t.getBoundingClientRect(), x2=tBounds.left + docScrolls.left + tBounds.width / 2; return [x1 - x2, 0]; }, translateY: function(t, i){ var docScrolls={ top: document.body.scrollTop + document.documentElement.scrollTop }, y1=window.innerHeight + docScrolls.top, tBounds=t.getBoundingClientRect(), y2=tBounds.top + docScrolls.top + tBounds.height / 2; return [y1 - y2, 0]; }, rotate:function(t, i){ var x1=window.innerWidth / 2, tBounds=t.getBoundingClientRect(), x2=tBounds.left + tBounds.width / 2; return [x2 < x1 ? 90:- 90, 0]; }, scale:[0, 1] }}, 'Ptah':{ itemOverflowHidden: true, sortTargetsFn:function(a, b){ return b.getBoundingClientRect().left - a.getBoundingClientRect().left; }, origin:'100% 0%', animeOpts:{ duration: 500, easing:'easeOutExpo', delay:function(t, i){ return i * 20; }, opacity:{ value:[0, 1], duration: 400, easing:'linear' }, rotateZ:[45, 0] }}, 'Bes':{ revealer:true, revealerOrigin:'100% 50%', animeRevealerOpts: { duration: 800, delay:function(t, i){ return i * 75; }, easing:'easeInOutQuart', scaleX:[1, 0] }, animeOpts:{ duration: 800, easing:'easeInOutQuart', delay:function(t, i){ return i * 75; }, opacity:{ value:[0, 1], easing: 'linear' }, scale:[0.8, 1] }}, 'Seker':{ revealer:true, revealerOrigin:'50% 100%', animeRevealerOpts: { duration:500, delay:function(t, i){ return i * 50; }, easing:[0.7, 0, 0.3, 1], translateY: [100, 0], scaleY:[1, 0] }, animeOpts:{ duration:500, easing:[0.7, 0, 0.3, 1], delay:function(t, i){ return i * 50; }, opacity:{ value:[0, 1], duration: 400, easing:'linear' }, translateY: [100, 0], scale:[0.8, 1] }}, 'Nut':{ revealer:true, revealerColor:'#ffffff', itemOverflowHidden: true, animeRevealerOpts:{ easing:'easeOutCubic', delay:function(t, i){ return i * 100; }, translateX: [{ value:['101%', '0%'], duration: 400 }, { value:['0%', '-101%'], duration: 400 }] }, animeOpts:{ duration: 900, easing:'easeOutCubic', delay:function(t, i){ return 400 + i * 100; }, opacity:{ value:1, duration: 1, easing:'linear' }, scale:[0.8, 1] }}, 'Shu':{ lineDrawing:true, animeLineDrawingOpts: { duration:800, delay:function(t, i){ return i * 150; }, easing:'easeInOutSine', strokeDashoffset: [anime.setDashoffset, 0], opacity:[{ value: [0, 1] }, { value:[1, 0], duration: 200, easing:'linear', delay:500 }] }, animeOpts:{ duration: 800, easing:[0.2, 1, 0.3, 1], delay:function(t, i){ return i * 150 + 800; }, opacity:{ value:[0, 1], easing: 'linear' }, scale:[0.5, 1] }} }; GridLoaderFx.prototype._render=function(effect, callback){ this._resetStyles(); var effectSettings=this.effects[effect], animeOpts=effectSettings.animeOpts if(effectSettings.perspective!=undefined){ [].slice.call(this.items).forEach(function(item){ item.style.WebkitPerspective=item.style.perspective=effectSettings.perspective + 'px'; }); } if(effectSettings.origin!=undefined){ [].slice.call(this.items).forEach(function(item){ item.style.WebkitTransformOrigin=item.style.transformOrigin=effectSettings.origin; }); } if(effectSettings.lineDrawing!=undefined){ [].slice.call(this.items).forEach(function(item){ var svg=document.createElementNS('http://www.w3.org/2000/svg', 'svg'), path=document.createElementNS('http://www.w3.org/2000/svg', 'path'), itemW=item.offsetWidth, itemH=item.offsetHeight; svg.setAttribute('width', itemW + 'px'); svg.setAttribute('height', itemH + 'px'); svg.setAttribute('viewBox', '0 0 ' + itemW + ' ' + itemH); svg.setAttribute('class', 'grid__deco'); path.setAttribute('d', 'M0,0 l' + itemW + ',0 0,' + itemH + ' -' + itemW + ',0 0,-' + itemH); path.setAttribute('stroke-dashoffset', anime.setDashoffset(path)); svg.appendChild(path); item.appendChild(svg); }); var animeLineDrawingOpts=effectSettings.animeLineDrawingOpts; animeLineDrawingOpts.targets=this.el.querySelectorAll('.grid__deco > path'); anime.remove(animeLineDrawingOpts.targets); anime(animeLineDrawingOpts); } if(effectSettings.revealer!=undefined){ [].slice.call(this.items).forEach(function(item){ var revealer=document.createElement('div'); revealer.className='grid__reveal'; if(effectSettings.revealerOrigin!=undefined){ revealer.style.transformOrigin=effectSettings.revealerOrigin; } if(effectSettings.revealerColor!=undefined){ revealer.style.backgroundColor=effectSettings.revealerColor; } item.appendChild(revealer); }); var animeRevealerOpts=effectSettings.animeRevealerOpts; animeRevealerOpts.targets=this.el.querySelectorAll('.grid__reveal'); animeRevealerOpts.begin=function(obj){ for(var i=0, len=obj.animatables.length; i < len; ++ i){ obj.animatables[i].target.style.opacity=1; }}; anime.remove(animeRevealerOpts.targets); anime(animeRevealerOpts); } if(effectSettings.itemOverflowHidden){ [].slice.call(this.items).forEach(function(item){ item.style.overflow='hidden'; }); } animeOpts.targets = effectSettings.sortTargetsFn&&typeof effectSettings.sortTargetsFn==='function' ? [].slice.call(this.items) .sort(effectSettings.sortTargetsFn):this.items; if(typeof callback!=='undefined'){ animeOpts.complete=callback; } anime.remove(animeOpts.targets); anime(animeOpts); }; GridLoaderFx.prototype._resetStyles=function(){ this.el.style.WebkitPerspective=this.el.style.perspective='none'; [].slice.call(this.items).forEach(function(item){ var gItem=item; item.style.opacity=0; item.style.WebkitTransformOrigin=item.style.transformOrigin='50% 50%'; item.style.transform='none'; var svg=item.querySelector('svg.grid__deco'); if(svg){ gItem.removeChild(svg); } var revealer=item.querySelector('.grid__reveal'); if(revealer){ gItem.removeChild(revealer); } gItem.style.overflow=''; }); }; window.GridLoaderFx=GridLoaderFx; } )(window); !function(n){var r=/([^&=]+)=?([^&]*)/g,e=/\+/g,t=function(n){return decodeURIComponent(n.replace(e," "))};n.parseParams=function(n){for(var e,u={};e=r.exec(n);){var a=t(e[1]),o=t(e[2]);"[]"===a.substring(a.length-2)?(a=a.substring(0,a.length-2),(u[a]||(u[a]=[])).push(o)):u[a]=o}return u}}(jQuery); ( function($){ "use strict"; learts.closeTopBar=function(){ var $closeBtn=$('.topbar-close-btn'), $openBtn=$('.topbar-open-btn'), $topBar=$('.topbar'), height=$topBar.outerHeight(); $closeBtn.on('click', function(e){ e.preventDefault(); if(! $topBar.hasClass('closed')){ $topBar.addClass('closed'); $('#page-container').css('margin-top', 0 - height); }}); $openBtn.on('click', function(e){ e.preventDefault(); if($topBar.hasClass('closed')){ $topBar.removeClass('closed'); $('#page-container').css('margin-top', 0); }}); }} )(jQuery); ( function($){ "use strict"; learts.switcher=function(){ var $body=$('body'), $languageSwitcher=$('.language-switcher select'), $currencySwitcher=$('.currency-switcher select'), $WOOCSCurrencySwitcher=$('.currency-switcher.woocs-switcher'), $WPMLCurrencySwitcher=$('.currency-switcher.wcml-switcher'); var loadCurrency=function(currency){ $.ajax({ type:'post', url:leartsConfigs.ajax_url, data:{ action:'wcml_switch_currency', currency: currency, }, success: function(){ window.location=window.location.href; }, error:function(error){ console.log(error); }, }); }; var WOOCSSwitcher=function(){ $('.option', $WOOCSCurrencySwitcher).on('click', function(){ $WPMLCurrencySwitcher.addClass('loading'); var $this=$(this); $('.currency-switcher').addClass('loading'); setTimeout(function(){ window.location=$this.attr('data-value'); }, 500); }); }; var wooWPMLSwitcher=function(){ $('.option', $WPMLCurrencySwitcher).on('click', function(){ $WPMLCurrencySwitcher.addClass('loading'); var currency=$(this).find('.option').attr('data-value'); loadCurrency(currency); }); }; $languageSwitcher.each(function(){ var $this=$(this); if($('option', $this).length){ $this.niceSelect(); var $niceSelect=$this.parent().find('.nice-select'), imgSrc=$this.find(':selected').attr('data-imagesrc'); if(typeof imgSrc!='undefined'){ $niceSelect.find('span.current').prepend(''); } $this.find('option').each(function(){ imgSrc=$(this).attr('data-imagesrc'); var index=$(this).index(); if(typeof imgSrc!='undefined'){ $niceSelect.find('.option') .eq(index) .prepend(''); }}); $body.on('click', '.language-switcher .nice-select .option', function(){ var $this=$(this); $('.language-switcher').addClass('loading'); setTimeout(function(){ window.location=$this.attr('data-value'); }, 500); }); }}); if($('option', $currencySwitcher).length){ $currencySwitcher.niceSelect(); WOOCSSwitcher(); wooWPMLSwitcher(); }};} )(jQuery); (function($){ "use strict"; learts.offcanvas=function(){ var $body=$('body'), $sidebar=$('.offcanvas-sidebar'), $offCanvasMenu=$('.offcanvas-menu'), $offCanvasButton=$('.offcanvas-btn > a'), $offCanvasClose=$('.offcanvas-close'), $pageContainer=$('#page-container'); if($offCanvasButton==null){ return; } var offcanvasSidebar=function(){ $offCanvasButton.on('click', function(e){ e.preventDefault(); $sidebar.addClass('open'); $body.addClass('offcanvas-sidebar-opened'); learts.setTopValue($sidebar); }); var closeSidebar=function(){ if($sidebar.hasClass('open')&&$body.hasClass('offcanvas-sidebar-opened')){ $sidebar.removeClass('open'); $body.removeClass('offcanvas-sidebar-opened'); }}; $offCanvasClose.on('click', function(e){ e.preventDefault(); closeSidebar(); }); $pageContainer.on('click', function(e){ if(! $(e.target).closest('.offcanvas-btn').length&&! $(e.target) .closest('.offcanvas-close a').length&&$sidebar.hasClass('open')){ e.preventDefault(); closeSidebar(); }}); $sidebar.find('.offcanvas-sidebar-inner').perfectScrollbar({ suppressScrollX: true }); } var fullscreenMenu=function(){ var interval=.5; $offCanvasMenu.find('.menu > li').each(function(){ $(this).css('transition-delay', interval + 's'); interval +=.1; }); $offCanvasButton.on('click', function(e){ e.preventDefault(); $offCanvasMenu.addClass('open'); $body.addClass('offcanvas-menu-opened'); learts.setTopValue($sidebar); }); var closeMenu=function(){ var $menu=$offCanvasMenu.find('.offcanvas-menu-wrapper .menu'); if($offCanvasMenu.hasClass('open')&&$body.hasClass('offcanvas-menu-opened')){ $menu.fadeOut(function(){ $body.removeClass('offcanvas-menu-opened'); $menu.fadeIn(); }); }}; $offCanvasClose.on('click', function(e){ e.preventDefault(); closeMenu(); }); $pageContainer.on('click', function(e){ if(! $(e.target).closest('.offcanvas-btn').length&&! $(e.target) .closest('.offcanvas-close a').length&&$sidebar.hasClass('open')){ e.preventDefault(); closeMenu(); }}); } if($sidebar.length){ offcanvasSidebar(); } if($offCanvasMenu.length){ fullscreenMenu(); }} })(jQuery); (function($){ "use strict"; var $window=$(window); learts.stickyHeader=function(){ if(! leartsConfigs.sticky_header){ return; } var $header=$('.site-header'), $topBar=$('.topbar'); if(! $header.length){ return; } if($header.hasClass('header-vertical')&&$window.width() >=1200){ return; } var $leftCol=$header.find('.left-col'), $logo=$header.find('.site-logo'), $menu=$header.find('.site-menu'), $tools=$header.find('.header-tools'), $search=$header.find('.header-search'), $offCanvaBtn=$header.find('.offcanvas-btn'); var stickyHeaderHTML='
' + suggestion.excerpt + '
'; } if(suggestion.id!=- 2){ returnValue +='' + pName + ' ' + leartsConfigs.added_to_cart_notification_text + ' ' + leartsConfigs.view_cart_notification_text + '
'; }else{ config['message'] = leartsConfigs.added_to_cart_text + ' ' + leartsConfigs.view_cart_notification_text + ''; } $.growl.notice(config); }); }; var addToWishlistNotification=function(){ $body.on('added_to_wishlist', function(){ $('#yith-wcwl-popup-message').remove(); config['message'] = '' + leartsConfigs.added_to_wishlist_text + ' ' + leartsConfigs.browse_wishlist_text + '
'; $.growl.notice(config); }); }; events(); if(leartsConfigs.shop_add_to_cart_notification_on){ addToCartNotification(); } if(leartsConfigs.shop_wishlist_notification_on){ addToWishlistNotification(); }} } )(jQuery); ( function($){ "use strict"; var $body=$('body'); learts.compare=function(){ $body.on('click', '.compare-btn .compare', function(){ $(this).parent().addClass('loading'); }); $body.on('yith_woocompare_open_popup', function(){ $('.compare-btn').removeClass('loading'); $body.addClass('compare-opened'); }); $body.on('click', '#cboxClose, #cboxOverlay', function(){ $body.removeClass('compare-opened'); }); }} )(jQuery); ( function($){ "use strict"; var $document=$(document), $body=$('body'); learts.ajaxAddToCart=function(){ if(typeof wc_add_to_cart_params!="undefined"&&wc_add_to_cart_params.cart_redirect_after_add==='yes'){ return; } $body.on('click', '.product .summary.ajax-add-to-cart .single_add_to_cart_button', function(){ var $button=$(this); if($button.hasClass('product_type_variable')){ return true; } if($button.closest('.product-type-external').length){ return true; } if($button.hasClass('disabled')||$button.hasClass('wc-variation-selection-needed')||$button.hasClass('wc-variation-is-unavailable')){ return false; } if($document.data('processing')===1){ return false; } $document.data('processing', 1); $document.data('processing_once', 0); var $form=$button.closest('form.cart'), buttonDefaultCusor=$button.css('cursor'), data=$.parseParams($form.serialize()); if(! $form.hasClass('variations_form')&&! $form.find('.group_table').length){ data['add-to-cart']=$form.find('button[name="add-to-cart"]').val(); } $body.css('cursor', 'wait'); $button.css('cursor', 'wait').blur().addClass('loading'); $.ajax({ type:'POST', url:$form.attr('action'), data:data, success: function(response){ if($(response).find('.woocommerce-error').length > 0){ appendMessageDiv(response, 'woocommerce-error'); $.growl.error({ location: 'tr', title:'', size:'large', message:'